package com.gtw.modules.sys.service.impl;

import com.gtw.modules.dao.TbActivityDao;
import com.gtw.modules.entity.TbActivity;
import com.gtw.modules.sys.service.SysTbActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/** 活动接口实现类
 * Created by wuye on 2018/2/26.
 */
@Service
public class SysTbActivityServiceImpl implements SysTbActivityService {

    @Autowired
    private TbActivityDao tbActivityDao;

    @Override
    public TbActivity queryObject(Integer id) {
        return tbActivityDao.queryObject(id);
    }

    @Override
    public List<TbActivity> queryList(Map<String, Object> map) {
        return tbActivityDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return tbActivityDao.queryTotal(map);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public void save(TbActivity activity) {
        tbActivityDao.insertSelective(activity);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public void update(TbActivity activity) {
        tbActivityDao.updateByPrimaryKey(activity);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public void delete(Integer id) {
        tbActivityDao.delete(id);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public void deleteBatch(Integer[] ids) {
        tbActivityDao.deleteBatch(ids);
    }
}
